<template>
    <div class="container" :class="classObj">
        <div class="aside">
            <div class="title" v-show="showLogo">
                <img class="logo" src="../assets/logo.png" height="20" width="20">
                <span class="text" v-if="!isCollaspe">ColorAdmin</span>
            </div>
            <Menu/>
        </div>
        <div class="content">
            <div :class="showTag ? 'header': 'header-notag' ">
                <Header/>
                <TagView class="tagview-box" v-show="showTag"/>
            </div>
            <div class="main">
                <router-view v-slot="{Component}" >
                    <transition name="fade-transform" mode="out-in">
                        <component :is="Component" />
                    </transition>
                </router-view>
            </div>
        </div>

        <Setting/>
    </div>
</template>

<script>
import Menu from '../components/Menu'
import Header from '../components/Header'
import TagView from '../components/TagView'
import Setting from './Component/Setting'
import { computed, reactive, ref, toRef } from 'vue'
import { useStore } from 'vuex'
export default {
    components:{
        Menu,Header,TagView,Setting
    },
    setup(){
        const {state} = useStore()

        const isCollaspe = toRef(state.menu,'isCollaspe')
        const classObj = reactive({
            hideMenu : isCollaspe
        })
        
        let showLogo = toRef(state.setting,'isLogo')
        let showTag = toRef(state.setting,'isTag')
    

        return{
            classObj,isCollaspe,showLogo,showTag
        }
    }
}
</script>

